package com.heima.search.controller;

import com.heima.model.common.dtos.ResponseResult;
import com.heima.model.common.dtos.UserSearchDto;
import com.heima.search.service.AssociateWordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 陈辉
 * @data 2024 17:10
 */
@RestController
@RequestMapping("/api/v1/associate")
public class AssociateWordController {

    @Autowired
    private AssociateWordService associateWordService;

    /**
     * 搜索词联想
     *
     * @param userSearchDto
     * @return
     */
    @PostMapping("search")
    public ResponseResult search(@RequestBody UserSearchDto userSearchDto){
        return associateWordService.search(userSearchDto);
    }
}
